From 2ca905db5ebeeb275e72629b535b8153f0ae9b01 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 30 Nov 2010 02:13:10 +0100 Subject: [PATCH] GtkStyleContext: Handle directionality when picking next provider. --- gtk/gtkstylecontext.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index 1ec47e2216..35d7eee06b 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -977,8 +977,9 @@ gtk_style_context_impl_get_property (GObject *object, } static GList * -find_next_candidate (GList *local, - GList *global) +find_next_candidate (GList *local, + GList *global, + gboolean ascending) { if (local && global) { @@ -988,9 +989,9 @@ find_next_candidate (GList *local, global_data = global->data; if (local_data->priority < global_data->priority) - return local; + return (ascending) ? local : global; else - return global; + return (ascending) ? global : local; } else if (local) return local; @@ -1014,7 +1015,7 @@ build_properties (GtkStyleContext *context, if (priv->screen) global_list = g_object_get_qdata (G_OBJECT (priv->screen), provider_list_quark); - while ((elem = find_next_candidate (list, global_list)) != NULL) + while ((elem = find_next_candidate (list, global_list, TRUE)) != NULL) { GtkStyleProviderData *data; GtkStyleProperties *provider_style; @@ -1053,7 +1054,7 @@ build_icon_factories (GtkStyleContext *context, global_list = g_list_last (global_list); } - while ((elem = find_next_candidate (list, global_list)) != NULL) + while ((elem = find_next_candidate (list, global_list, FALSE)) != NULL) { GtkIconFactory *factory; GtkStyleProviderData *data; @@ -2280,7 +2281,7 @@ _gtk_style_context_peek_style_property (GtkStyleContext *context, list = priv->providers_last; global = global_list; - while ((elem = find_next_candidate (list, global)) != NULL) + while ((elem = find_next_candidate (list, global, FALSE)) != NULL) { GtkStyleProviderData *provider_data; -- 2.30.2